﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class collector : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        // Get our query string, original client IP and user agent
        string inboundquerystring = HttpContext.Current.Request.QueryString.ToString();
        string clientip = HttpContext.Current.Request.Headers.Get("ClientIP");
        string useragent = HttpContext.Current.Request.UserAgent;
        string visitorid = HttpContext.Current.Request.Headers.Get("VisitorID");
        string remoteserverIP = HttpContext.Current.Request.UserHostAddress;
        string clientSessionID = HttpContext.Current.Request.Headers.Get("SessionID");
        
        // Create a new tracking response       
        CookieFreeAnalyticsCollector.VisitorTracked tracked = new CookieFreeAnalyticsCollector.VisitorTracked(inboundquerystring, clientip, useragent,visitorid,remoteserverIP,clientSessionID);
        
        // Pass it to our Collector
        CookieFreeAnalyticsCollector.CookieFreeCollector.AddResponse(clientip + ": " + inboundquerystring, tracked);
    }
}